package router

import "github.com/gin-gonic/gin"

func XMLRoute(router gin.IRouter) {
	router.GET("/someXML", func(c *gin.Context) {
		c.XML(200, gin.H{
			"message": "hello xml",
		})
	})

	router.GET("/moreXML", func(c *gin.Context) {
		type MessageRecord struct {
			Name    string
			Message string
			Age     int
		}
		var msg MessageRecord
		msg.Name = "小王子"
		msg.Message = "Hello world!"
		msg.Age = 18

		c.XML(200, msg)
	})
}
